var mCharts = echarts.init(document.querySelector("#heatmap")); /*实例化为mCharts*/
const hours = [  /*小时数据系列*/
	'12a', '1a','2a'
];
const days = [ /*日期系列*/
	'Saturday', 'Friday'
];
var data = [[0,0,5],[0,1,1],[0,2,3],[1, 0, 2],[1,1,1]] /*纵轴类目数,横轴项目数,热力值 */
	.map(function (item) {
		console.log(item) /*控制台打印item*/
	return [item[1], item[0], item[2] || '-'];
});

option = {
	title:{
		text:'热力图',
		left:'40%',
		textStyle:{
			color:'orange'
		}
	},
	xAxis: {
		type: 'category',

		data: hours
	  },
	  yAxis: {
		type: 'category',
		data: days
		
	  },
	  visualMap: {
		min: 0,
		max: 10,
		// calculable: true,
		left: 'center',/*居中*/
		orient: 'horizontal',/**/
		bottom: '-10'
	  },
	  series: 
		{
		  name: 'Punch Card',
		  type: 'heatmap',
		  data: data
		  ,label: {
			show: true
		  }
		}
	};
	mCharts.setOption(option);